﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetMarkValue
    {
        #region Get MarkValues

        public static List<MarkValue> GetMarkValues()
        {
            
                IQueryable<MarkValue> tMarkValue = from cs in ctx.MarkValue
                                                   select cs;
                return tMarkValue.ToList();
            
        }

        public static List<MarkValue> GetMarkValuesById(int mId)
        {
            
                IQueryable<MarkValue> tMarkValue = from cs in ctx.MarkValue
                                                   where cs.id == mId
                                                   select cs;
                return tMarkValue.ToList();
            
        }

        public static List<MarkValue> GetMarkValuesByValueRange(int mValueMin, int mValueMax)
        {
            
                IQueryable<MarkValue> tMarkValue = from cs in ctx.MarkValue
                                                   where cs.value >= mValueMin && cs.value <= mValueMax
                                                   select cs;
                return tMarkValue.ToList();
            
        }


       

        public static List<MarkValue> GetMarkValues(MarkValue mMarkValue)
        {
           
                IQueryable<MarkValue> tCrew = from cs in ctx.MarkValue
                                              where cs == mMarkValue
                                              select cs;
                return tCrew.ToList();
           
        }

        public static List<MarkValue> GetMarkValues(Mark mMark)
        {
            
                IQueryable<MarkValue> tCrew = from cs in ctx.MarkValue
                                              where cs.fk_mark == mMark.id_mark
                                              select cs;
                return tCrew.ToList();
            
        }
     

        public static List<MarkValue> GetMarkValues(Flight mFlight)
        {
            
                IQueryable<MarkValue> tCrew = from cs in ctx.MarkValue
                                              where cs.fk_flight == mFlight.id_flight
                                              select cs;
                return tCrew.ToList();
            
        }



        static testdbsEntities ctx = new testdbsEntities();

        #endregion
    }
}
